struct InputVertex
{
	float4 Position	: POSITION;
	float2 TexCoord : TEXCOORD0;
};

struct OutputVertex
{
	float4 Position	: POSITION;
	float2 TexCoord	: TEXCOORD0;
};

struct OutputPixel
{
    float4 Color	: COLOR0;
};

Texture diffuseTexture;

sampler DiffuseTextureSampler = sampler_state 
{ 
	texture		= <diffuseTexture>; 
	magfilter	= LINEAR; 
	minfilter	= LINEAR; 
	mipfilter	= LINEAR; 
	AddressU	= mirror; 
	AddressV	= mirror;
};

OutputVertex PostProcessingInvertVertexShader( InputVertex input )
{
    OutputVertex output = (OutputVertex)0;
    
    output.Position = input.Position;
    output.TexCoord = input.TexCoord;
    
    return output;    
}

OutputPixel PostProcessingInvertPixelShader( OutputVertex input )
{
    OutputPixel output = (OutputPixel)0;
	
    output.Color = 1.0f - tex2D( DiffuseTextureSampler, input.TexCoord );
	output.Color.a = 1.0f;

    return output;
}

technique PostInvert
{
    pass Pass0
    {
        VertexShader	= compile vs_2_0 PostProcessingInvertVertexShader();
        PixelShader		= compile ps_2_0 PostProcessingInvertPixelShader();
    }
}